package com.baizhi.cmfzmanager.appcontroller;

import com.baizhi.cmfzmanager.entity.Album;
import com.baizhi.cmfzmanager.service.AlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shouye")
public class AppAlbumController {

    @Autowired
    private AlbumService albumService;
    @GetMapping("/getShouyeAlbum")
    public List<Album> getShouyeAlbum(){
        return albumService.getShouyeAlbum();
    }

    @GetMapping("/getAllAlbum")
    public List<Album> getAllAlbum(){
        return albumService.getAllAlbum();
    }


    @GetMapping("getAlbumById/{id}")
    public Album getAlbumById(@PathVariable("id") Integer id){

        return albumService.getAlbumById(id);
    }

}
